﻿using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
using FunstreamTV.Model.Chat;
using FunstreamTV.Tools;
using static System.String;

namespace FunstreamTV.ViewModel.ObjectViewModel
{
    public class ChatMessageViewModel : ChatMessage
    {
        public SolidColorBrush FromNickColor
        {
            get
            {
                switch (from.namecolor)
                {
                    case 0: return new SolidColorBrush(Color.FromArgb(255, 219, 195, 113));
                    case 1: return new SolidColorBrush(Color.FromArgb(255, 255, 227, 130));
                    case 2: return new SolidColorBrush(Color.FromArgb(255, 255, 237, 175));
                    case 3: return new SolidColorBrush(Color.FromArgb(255, 222, 214, 187));
                    case 4: return new SolidColorBrush(Color.FromArgb(255, 188, 184, 171));
                    case 5: return new SolidColorBrush(Color.FromArgb(255, 104, 87, 231));
                    case 6: return new SolidColorBrush(Color.FromArgb(255, 139, 125, 245));
                    case 7: return new SolidColorBrush(Color.FromArgb(255, 162, 153, 229));
                    case 8: return new SolidColorBrush(Color.FromArgb(255, 155, 148, 195));
                    case 9: return new SolidColorBrush(Color.FromArgb(255, 131, 127, 157));
                    case 10: return new SolidColorBrush(Color.FromArgb(255, 72, 176, 224));
                    case 11: return new SolidColorBrush(Color.FromArgb(255, 123, 202, 238));
                    case 12: return new SolidColorBrush(Color.FromArgb(255, 163, 205, 224));
                    case 13: return new SolidColorBrush(Color.FromArgb(255, 162, 183, 192));
                    case 14: return new SolidColorBrush(Color.FromArgb(255, 139, 150, 155));
                    default: return new SolidColorBrush(Colors.BlueViolet);
                }
            }
        }
        
        public Visibility ToArrowVisibility => IsNullOrEmpty(to?.name) ? Visibility.Collapsed : Visibility.Visible;
    }
}
